package edu.hunau.cxb19.oop.class05.ex;

import org.junit.Test;

/**
 *
 *@author hb
 *
 * 2020-02-28 14:24:41
 */
public class ObjExTest {
	@Test
	public void test() {
		Foo f = new Goo();//null
	}
}
class Foo{
	private String name="from Foo";
	//A from Foo  B from Goo  C null
	public Foo() {		System.out.println(getName());	}//子类的getName方法
 	public String getName() {System.out.println("foo getName...");		return name;	}
 	public void setName(String name) {		this.name = name;	}
}

class Goo extends Foo{
	//private String name="from Goo";
	private String name;

 	public Goo() { 
 		 //super(); name="from Goo"; 
 	}
  
	public String getName() {	System.out.println("Goo getName...");	return name;	}
 	public void setName(String name) {		this.name = name;	}
}
